<div class="modal fade" id="addModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog" style="width:400px">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
            	编辑菜单
            </h4>
         </div>
         <div class="modal-body">
           		<input type="hidden" name="id" value="${role.id}"/>
           		<table class="table">
           			<tr>
           				<td  width="30%">
           				角色名：
           				</td>
           				<td  width="70%">
           					 <input type="text" id="roleName" name="roleName" value="${role.roleName}" placeholder="请输入角色名"/>
           				</td>
           			</tr>
           		</table>
           		授权信息：
           		<center>
				    <div id="tree">
				        <ul id="treeDemo" class="ztree"></ul>
				    </div>
		        </center>
         </div>
         </br>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
            <button type="button" class="btn btn-primary" onclick="addRole();">
              	 提交更改
            </button>
         </div>
      </div>
</div>
<script>
var zTree;
var setting = {
    isSimpleData : true, //数据是否采用简单 Array 格式，默认false
    showLine : true, //是否显示节点间的连线
    checkable : true, //每个节点上是否显示 CheckBox
    callback: {
        
    },
    data:{
		simpleData: {
			enable: true,
			idKey: "id",
			pIdKey: "parentId",
			rootPId: 0
		}
    },
	check: {
		enable: true,
		nocheckInherit: true
	}
};
var tree = ${menuJson}
//后台传递的Jsontree

zTree = $.fn.zTree.init($("#treeDemo"), setting, tree);

var treeObj = $.fn.zTree.getZTreeObj("treeDemo");

</script>